package com.xuxin.queue.adapter;

import android.widget.LinearLayout;

import com.blankj.utilcode.util.ColorUtils;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.xuxin.queue.R;
import com.xuxin.queue.bean.QueueBean;

import org.jetbrains.annotations.NotNull;

/**
 * Created by xu_xin
 * Created on 2020.08.07 0007
 */
public class QueueAdapter extends BaseQuickAdapter<QueueBean.ResultBean, BaseViewHolder> {

    public QueueAdapter() {
        super(R.layout.item_queue);
    }

    @Override
    protected void convert(@NotNull BaseViewHolder holder, QueueBean.ResultBean item) {
        LinearLayout call = holder.getView(R.id.item_queue);
        if (holder.getLayoutPosition() % 2 != 0) {
            call.setBackgroundColor(ColorUtils.getColor(R.color.colorWhite));
        }else {
            call.setBackgroundColor(ColorUtils.getColor(R.color.color2));
        }
        holder.setText(R.id.item_queue_room, item.getRoomName());
        holder.setText(R.id.item_queue_doctor, item.getSeeDoctor());
        holder.setText(R.id.item_queue_wait, item.getWaiting());
    }
}